#指定cmake最小版本
cmake_minimum_required(VERSION 3.4.1)

#设置生成的so动态库最后输出的路径
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/jniLibs/${ANDROID_ABI})

#生成so
add_library( # 设置生成库的名字
        add

        # 生成动态库
        SHARED

        # 指定源码文件，这里指定test.cpp文件
        ${CMAKE_SOURCE_DIR}/test.c )

#依赖的头文件
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/)


find_library( # log库的别名
        log-lib

        #log库
        log )


#链接代码到指定的库
target_link_libraries( # Specifies the target library.
        add

        # Links the target library to the log library
        # included in the NDK.
        ${log-lib} )